home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / TestParts / Draw / PrtPrpAc.h < prev   
Encoding:
C/C++ Source or Header  |  1997-01-01  |  4.3 KB  |  159 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        PrtPrpAc.h
  3.  
  4.     Contains:    Interface to class that handles accessing part properties for
  5.                 the OpenDoc shell.
  6.  
  7.     Owned by:    Nick Pilch
  8.  
  9.     Copyright:    © 1993 - 1995 by Apple Computer, Inc., all rights reserved.
  10.  
  11.     Change History (most recent first):
  12.  
  13.          <3>     3/24/95    eeh        1232264: use ODFrame* rather than ODPart*
  14.                                     to keep track of parts
  15.          <2>     1/25/95    jpa        Renamed SOM class to Container [1213318]
  16.          <1>     8/30/94    NP        first checked in
  17.          <6>     1/19/94    eeh        fixed G/SetData param types
  18.          <5>     1/11/94    eeh        nuke FramePropAccessor class; mods to
  19.                                     others
  20.          <4>     12/9/93    eeh        new classes AbsDrawPartPropAccessor,
  21.                                     DragPartPropAccessor and FramePropAccessor
  22.          <3>     12/1/93    CG        Added new class EmbeddedPartPropAccessor
  23.                                     for getting pBounds and pTranslation from
  24.                                     an embedded part.
  25.          <2>    11/16/93    CG        Includes DrawPart.h
  26.          <1>     9/10/93    NP        first checked in
  27.  
  28.     To Do:
  29. */
  30.  
  31. #ifndef _PRTPRPAC_
  32. #define _PRTPRPAC_
  33.  
  34. #ifndef _PLFMDEF_
  35. #include "PlfmDef.h"
  36. #endif
  37.  
  38. #ifndef __APPLEEVENTS__
  39. #include <AppleEvents.h>
  40. #endif
  41.  
  42. //==============================================================================
  43. // Theory of Operation
  44. //==============================================================================
  45.  
  46. /*
  47.     This a simple abstract class to aid in the processing of Apple Events that
  48.     are requests to get or set properties. Since OpenDoc does the resolution
  49.     first, the object accessor routines can allocate one of these classes
  50.     according to the property for which they have been asked to create a token.
  51.     When passed back to the event handler, the event handler need only call the
  52.     the appropriate member function of this class, GetData or SetData, to
  53.     process the event. The event handler must then delete the object.
  54. */
  55.  
  56. //==============================================================================
  57. // Constants
  58. //==============================================================================
  59.  
  60. //==============================================================================
  61. // Scalar Types
  62. //==============================================================================
  63.  
  64. //==============================================================================
  65. // Classes defined in this interface
  66. //==============================================================================
  67.  
  68. class DrawPartPropAccessor;
  69. class EmbeddedPartPropAccessor;
  70. class DragPartPropAccessor;
  71.  
  72. //==============================================================================
  73. // Classes used by this interface
  74. //==============================================================================
  75.  
  76. class ODObject;
  77. class ODFrame;
  78. class AppleTest_Container;
  79. class DragPart;
  80.  
  81. //==============================================================================
  82. // PropAccessor
  83. //==============================================================================
  84.  
  85. class AbsDrawPartPropAccessor
  86. {
  87.     public:
  88.         AbsDrawPartPropAccessor(DescType property, ODObject* object);
  89.         ODVMethod void SetData(AEDesc* data);
  90.         ODVMethod void GetData(AEDesc* result);
  91.     
  92.         ODMethod DescType GetProperty();
  93.  
  94.     protected :
  95.         ODMethod ODObject* GetObject() ;
  96.  
  97.     private:
  98.         ODObject*    fObject;
  99.         DescType    fProperty;
  100. };
  101.  
  102. class DrawPartPropAccessor : public AbsDrawPartPropAccessor
  103. {
  104.   public:
  105.  
  106.     DrawPartPropAccessor(DescType property, ODFrame* frame);
  107.  
  108.     ODMethod void SetData(AEDesc* data);
  109.     ODMethod void GetData(AEDesc* result);
  110.     
  111.     ODMethod ODFrame* GetFrame() ;
  112. };
  113.  
  114. class EmbeddedPartPropAccessor : public AbsDrawPartPropAccessor
  115. {
  116.     public:
  117.         EmbeddedPartPropAccessor( DescType property, ODFrame* frame,
  118.             AppleTest_Container* me ) ;
  119.         
  120.         ODMethod void SetData(AEDesc* data);
  121.         ODMethod void GetData(AEDesc* result);
  122.         
  123.         ODMethod ODFrame* GetFrame() ;
  124.         ODMethod AppleTest_Container* GetThisPart() ;
  125.  
  126.     private:
  127.         AppleTest_Container* fDrawPart ;
  128. };
  129.  
  130. #ifdef TO_BE_DELETED
  131. class FramePropAccessor : public AbsDrawPartPropAccessor
  132. {
  133.   public:
  134.  
  135.     FramePropAccessor(DescType property, ODFrame* frame);
  136.  
  137.     ODMethod void SetData(AEDesc* data);
  138.     ODMethod void GetData(AppleEvent* reply);
  139.  
  140.     ODMethod ODFrame* GetFrame() ;
  141. };
  142. #endif // TO_BE_DELETED
  143.  
  144. class DragPartPropAccessor
  145. {
  146.   public:
  147.  
  148.     DragPartPropAccessor(DescType property, DragPart* part);
  149.  
  150.     ODVMethod void SetData(AEDesc* data);
  151.     ODVMethod void GetData(AEDesc* result);
  152.  
  153.   private:
  154.  
  155.     DescType    fProperty;
  156.     DragPart*    fPart;
  157. };
  158.  
  159. #endif // _PRTPRPAC_